package com.symone.webcms.service.impl;

import com.symone.webcms.model.DataExt;
import com.symone.webcms.mapper.DataExtMapper;
import com.symone.webcms.service.DataExtService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 *　　
 *   @description : ContentExt 服务实现类
 *   ---------------------------------
 * 	 @author Archer Chu
 *   @since 2019-03-24
 */
@Service
public class DataExtServiceImpl extends ServiceImpl<DataExtMapper, DataExt> implements DataExtService {

    @Override
    public Page<DataExt> findPage(Page<DataExt> page, Wrapper<DataExt> contentExt) {
        List<DataExt> result = baseMapper.selectPage(page,contentExt);
        page.setRecords(result);
        return page;
    }

    @Override
    public List<DataExt> findAll() {
        Wrapper<DataExt> ew = new EntityWrapper<DataExt>();
        ew.where("deleted=0");
        return baseMapper.selectList(ew);
    }

    @Override
    public int delete(long id) {
        return baseMapper.deleteById(id);
    }

    @Override
    public boolean deleteFlagById(long id) {
        return baseMapper.deleteFlagById(id);
    }

    @Override
    public int clear() {
        return baseMapper.delete(new EntityWrapper<DataExt>().eq("deleted" ,1));
    }

    @Override
    public boolean deleteObject(Long cid,String lang,String module){
        return baseMapper.deleteObject(cid,lang,module);
    }
	
}
